package com.mky.myrule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MySelfRule {

    @Bean
    public IRule myRule(){
       // return new RandomRule();//Ribbon默认是轮询，自定义为随机
        //指向自定义的算法类RandomRule_MKY
        return new RandomRule_MKY();
    }

}
